There is known an image scanner that reads an image of an original document for each scanning line by scanningly moving a line sensor in a state where a document cover for holding the original document is open.
When reading an image of an original document while the document cover is open, the above image scanner consecutively reads outside light and an image of an original document by controlling turn-on and turn-off of the light source for each scanning line. The image scanner generates outside light detection data from outside light image data read upon turn-off of the light source, and generates multivalued image data from original document image data read upon turn-on of the light source. The image scanner reads the image of the original document upon removing the influence of the outside light by detecting the outside light and each end portion of the image of the original document from the outside light detection data and the multivalued image data and executing the mask processing of removing the influence of the outside light from the multivalued image data.